package com.order.api.controller;

import com.github.pagehelper.PageInfo;
import com.order.api.po.TblLog;
import com.order.api.service.LogService;
import com.order.api.vo.BaseResult;
import com.order.api.vo.request.LogListRequest;
import com.order.api.vo.response.PageResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "日志模块")
@RestController
@RequestMapping("/log")
public class LogController {
    @Autowired
    private LogService logService;

    @ApiOperation("日志列表")
    @RequestMapping(value = "/list", method = RequestMethod.POST)
    public BaseResult<PageResponse<TblLog>> logList(@RequestBody LogListRequest request) {
        PageInfo<TblLog> list = logService.LogList(request);
        return BaseResult.success(PageResponse.getInstance(list));
    }

}
